/* Mini-XAF Global Styles */

/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* Mini-XAF Application */
.mini-xaf-application {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Window Component */
.mini-xaf-window {
  display: flex;
  flex-direction: column;
  height: 100%;
  
  .window-header {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
    
    h1 {
      margin: 0;
      font-size: 1.5rem;
      font-weight: 500;
    }
  }
  
  .window-content {
    flex: 1;
    display: flex;
    overflow: hidden;
  }
  
  .frame-container {
    flex: 1;
    padding: 0.5rem;
    overflow: auto;
    
    &.active {
      border: 1px solid #ddd;
      border-radius: 4px;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    }
  }
}

/* Frame Component */
.mini-xaf-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  
  .frame-header {
    padding: 0.5rem;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    
    h3 {
      margin: 0;
      font-size: 1.2rem;
      font-weight: 500;
    }
  }
  
  .frame-content {
    flex: 1;
    padding: 0.5rem;
    overflow: auto;
  }
  
  .empty-frame {
    padding: 2rem;
    text-align: center;
    color: #999;
    font-style: italic;
  }
}

/* ListView Component */
.mini-xaf-list-view-component {
  height: 100%;
  display: flex;
  flex-direction: column;
  
  .list-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    
    h2 {
      margin: 0;
      font-size: 1.3rem;
      font-weight: 500;
    }
    
    .action-buttons {
      display: flex;
      gap: 0.5rem;
    }
  }
}

/* DetailView Component */
.mini-xaf-detail-view-component {
  height: 100%;
  display: flex;
  flex-direction: column;
  
  .detail-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    
    h2 {
      margin: 0;
      font-size: 1.3rem;
      font-weight: 500;
    }
    
    .action-buttons {
      display: flex;
      gap: 0.5rem;
    }
  }
  
  .form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
  }
}

/* Property Editors */
.mini-xaf-property-editor {
  margin-bottom: 1rem;
  
  label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
  }
  
  input[type="text"],
  input[type="number"],
  input[type="date"],
  select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    
    &:focus {
      outline: none;
      border-color: #005eb8;
      box-shadow: 0 0 0 2px rgba(0, 94, 184, 0.1);
    }
    
    &:disabled {
      background-color: #f5f5f5;
      cursor: not-allowed;
    }
  }
  
  &.boolean-property-editor {
    label {
      display: flex;
      align-items: center;
      
      input {
        margin-right: 0.5rem;
      }
    }
  }
}

/* Action buttons */
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background-color: #005eb8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  
  .action-icon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
  }
  
  &:hover {
    background-color: #004a8f;
  }
  
  &:disabled {
    background-color: #ccc;
    cursor: not-allowed;
  }
}

.save-button {
  background-color: #28a745;
  
  &:hover {
    background-color: #218838;
  }
}

.cancel-button {
  background-color: #6c757d;
  
  &:hover {
    background-color: #5a6268;
  }
}

/* Loading and error states */
.loading-container {
  padding: 2rem;
  text-align: center;
  
  h2 {
    margin-bottom: 1rem;
  }
  
  .loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #005eb8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
}

.error-container {
  padding: 2rem;
  text-align: center;
  
  h2 {
    color: #dc3545;
  }
  
  button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #005eb8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
